using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SPDV
{
    public partial class SPListForm : Form
    {
        public SPListData ListData
        {
            set
            {
                SPListData l = (SPListData)value;
                if (null != l)
                {
                    lblTitle.Text = l.Title + " " + l.ID;
                    dgvFolders.DataSource = l.ds;//l.folders;
                    dgvFolders.DataMember = "folders";
                    dgvItems.DataSource = l.ds;//l.items;
                    if (null != l.ds.Relations["folder2item"])
                        dgvItems.DataMember = "folders.folder2item";
                    else dgvFolders.DataMember = "items";
                }
            }
        }
        public SPListForm()
        {
            InitializeComponent();
        }

        private void SPListForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape) Close();
        }
    }
}